<!DOCTYPE html>
<html>

<head>

	<link rel="stylesheet" href="../../lib/layui/css/layui.css">
	<link rel="stylesheet" href="../../css/oksub.css">
	<meta charset="utf-8">
	<title></title>
</head>
<style>
	.list-con {
		padding: 0 10px 15px 10px;
		margin-bottom: 20px;
	}

	.list-con .layui-table td,

	.layui-table-view,
	.layui-table[lay-skin=line],
	.layui-table[lay-skin=row] {
		border: none;
	}
	.list-con .layui-table tbody {
		color: #777777;
	}

	.list-con .layui-table tbody tr:hover,
	.layui-table[lay-even] tr:nth-child(even) {
		background-color: rgb(255, 255, 255);
		color: #000000;
	}
	.layui-table tr{
		border-bottom: 1px #e2e2e2 solid;
	}

</style>

<body>
	<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
	<!--[if lt IE 9]>
		  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
		  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>待审批警情</legend>
		<div style="z-index: 9999; position: fixed ! important; right:50px; top: 15px;">
			<div id="selectForm" style="float: right; margin-right:50px;" lay-event="search" class="layui-btn layui-btn-normal layui-btn-radius">
				<i class="layui-icon layui-icon-search"></i>
			</div>
			<div id="backAll" style="float: right; margin-right:10px;"
				 class="layui-btn layui-btn-normal layui-btn-radius" lay-event="backAll">
				刷新
			</div>
		</div>
	</fieldset>
	<!--数据表格-->
	<div class="list-con">
	<table class="layui-hide" id="tableId" lay-filter="tableId"></table>
	</div>
</body>
<script src="../../lib/layui/layui.js"></script>
<script src="../../js/jquery.min.js"></script>
<script src="../../js/application.js"></script>
<script src="../../js/model.js"></script>
<script>
	layui.use([ "table", 'laydate','okLayer'], function () {
		let $ = layui.jquery;
		let table = layui.table;
		var form = layui.form, laydate = layui.laydate;

		let okLayer = layui.okLayer;
  		//从session获取登录警员信息
		var policeInfo = JSON.parse(window.sessionStorage.getItem("police"));
		//下一个处理者id
		var nextpoliceid = policeInfo.policeId
		//搜索
		$("#selectForm").on('click', selectForm)
		function selectForm() {
			okLayer.open("查询条件", "selectForm.html", "35%", "60%", function (layero) {
				let iframeWin = window[layero.find("iframe")[0]["name"]];
			}, function (obj) {
				//根据子页面传过来的查询参数进行查询
				var caseId = window.document.caseId;
				var procLevel = window.document.procLevel;
				var caseDescription = window.document.caseDescription;
				var startTime = window.document.startTime;
				var endTime = window.document.endTime;
				//将搜索框置空
				window.document.caseId="";
				window.document.procLevel="";
				window.document.caseDescription="";
				window.document.startTime="";
				window.document.endTime="";
				var isChange=window.document.isChange;
				window.document.isChange=0
				if(isChange!=1){
					return
				}
				articleTable.reload({
					url: mainUri + "/VCaseProcInfoByPolice/selectCheckByStament",
					where: {
						nextpoliceId:police.policeId,caseId: caseId, procLevel: procLevel, caseDescription: caseDescription,
						startTime: startTime, endTime: endTime
					},
				})
			})
		}
		//刷新
		$("#backAll").on('click', backAll)
		function backAll(){
			articleTable.reload({
				url:mainUri+"/VCaseProcInfoByPolice/selectVCaseProcInfoByPolicesStatus",
				where: {nextpoliceid:nextpoliceid},
			})
		}
        //获取待审批列表
		let articleTable = table.render({
			elem: "#tableId",
			url:  mainUri+"/VCaseProcInfoByPolice/selectVCaseProcInfoByPolicesStatus",
			where: {nextpoliceid:nextpoliceid},
            toolbar:true,
			page: {
				layout: ['prev', 'page', 'next', 'skip', 'count'],
				groups: 3,
				limit: 15,
				theme: '#1E9FFF',
			},
			cols: [[
				{field: "processId", title: "指派编号", hide: true},
				{field: "caseId", title: "警情编号", width: 180},
				{field: "caseDescription", title: "警情描述"},
				{
					field: "procLevel", title: "督办级别", width: 90, templet: function (d) {
						if (d.procLevel == "一级") {
							return "<div style='color:#d92d29;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else if (d.procLevel == "二级") {
							return "<div style='color:#f09614;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else if (d.procLevel == "三级") {
							return "<div style='color:#fae600;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						} else{
							return "<div style='color:#478f43;font-weight: bold;font-size:15px'>" + d.procLevel + "</div>"
						}
					}
				},
				{field: "procperiod", title: "处理时长(日)",width:110},
				{field: "askFullName", title: "分派者", width: 100},
				{field: "askForTime", title: "分派时间", width: 190},
				{field: "procTatus", title: "警情状态", hide: true}

			]]
		});

		//监听行单击事件（双击事件为：rowDouble）
		table.on('row(tableId)', function (obj) {
			var data = obj.data;
			let url="myCheckPending.html?processid="+data.processId;
				url+="&caseid="+data.caseId;
			show(url);

			//标注选中样式
			obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
		});
		//跳转详细页设置
		function show(uri) {
			window.open (uri,'newwindow','width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+ ', top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no')
		}
	})
</script>



</html>